package com.andreams.restaurant.domain;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
@Entity
public class Restaurant {

	@Id
	private Long id;
	private String name;
	private Long latitude;
	private Long Longitude;
	private Long altitude;
	private Integer rating;

	public Restaurant() {}
	
	public Restaurant(String name, Long latitude, Long Longitude,
			Long altitude, int rating) {
		super();
		this.name = name;
		this.latitude = latitude;
		this.Longitude = Longitude;
		this.altitude = altitude;
		this.rating = rating;
	}

	public Restaurant(Long id, String name, Long latitude, Long Longitude,
			Long altitude, int rating) {
		super();
		this.id = id;
		this.name = name;
		this.latitude = latitude;
		this.Longitude = Longitude;
		this.altitude = altitude;
		this.rating = rating;
	}

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Long getLatitude() {
		return latitude;
	}
	public void setLatitude(Long latitude) {
		this.latitude = latitude;
	}
	public Long getLongitude() {
		return Longitude;
	}
	public void setLongitude(Long Longitude) {
		this.Longitude = Longitude;
	}
	public Long getAltitude() {
		return altitude;
	}
	public void setAltitude(Long altitude) {
		this.altitude = altitude;
	}
	public Integer getRating() {
		return rating;
	}
	public void setRating(Integer rating) {
		this.rating = rating;
	}
	
	@Override
    public boolean equals(Object other) {
        if (this == other) return true;
        if ( !(other instanceof Restaurant) ) return false;

        final Restaurant restaurant = (Restaurant) other;

        if (!restaurant.getName().equals(getName())) return false;
        if (restaurant.getLatitude() != getLatitude()) return false;
        if (restaurant.getLongitude() != getLongitude()) return false;
        if (restaurant.getAltitude() != getAltitude()) return false;

        return true;
    }
	
}
